<?php
declare (strict_types = 1);

namespace app\admin\controller;

use app\admin\model\Category;
use app\admin\model\Goods;
use app\Request;
use think\View;

class Good
{
    public function cate()
    {

        $all=Category::all();
        \think\facade\View::assign('all',$all);
        return \view();
    }

    public function cateEdit()
    {
        return \view();
    }

    public function goodAdd()
    {
        return \view();
    }

    public function goodList()
    {
        $zong=\think\facade\Request::param();
        $where=[];
        if(isset($zong['keywords'])&&$zong['keywords']<>'')$where['keywords']=$zong['keywords'];
        if(isset($zong['is_show'])&&$zong['is_show']<>'')$where['is_show']=$zong['is_show'];
        if(isset($zong['is_hot'])&&$zong['is_hot']<>'')$where['is_hot']=$zong['is_hot'];
        if(isset($zong['is_down'])&&$zong['is_down']<>'')$where['is_down']=$zong['is_down'];
        $all=Goods::all($where);
        \think\facade\View::assign('all',$all);
        return \view();
    }
}